<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1

//or response.setHeader("Cache-Control","no-store");//HTTP 1.1

response.setHeader("Pragma","no-cache"); //HTTP 1.0

response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>计费后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/wbox.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/wbox.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate.js"></script>
<script type="text/javascript">
<!--
	$(function(){
		$(".list div").mousemove(function(){
			$(this).css("background","#E3EEFF");
		}).mouseout(function(){
			$(this).css("background","");
		});
		$("#addCompany").click(function(){
			var wBox = $("#ajax").wBox({
				requestType: "iframe",
				iframeWH:{width:900,height:500},
				target:"<%=request.getContextPath() %>/manage/companyAdd.jsp",
				title: "添加新的厂商"
			});
			wBox.showBox();
		});
	});

	function show(companyId){
		var wBox = $("#ajax").wBox({
			requestType: "iframe",
			iframeWH:{width:900,height:500},
			target:"<%=request.getContextPath() %>/admin/company/view/"+companyId,
			title: "查看厂商详细信息"
		});
		wBox.showBox();
	}

	function del(companyId){
		if(confirm("你确认删除该厂商吗?")){
			$.ajax({
				url:"<%=request.getContextPath() %>/admin/company/del/"+companyId,
				type:"GET",
				success:function(flag){
					if(flag=='1'){
						alert("删除成功!");
						window.location.href= "<%=request.getContextPath() %>/admin/company";
					}else{
						alert("删除失败!");
					}
				}
			});
		}
	}
//-->
</script>
</head>
<body>
<div class="information">
	<div class="title">厂商列表</div>
	<div class="search">
		<form action="<%=request.getContextPath() %>/admin/company" method="post">
		SP名称:<input name="spname" type="text" value=""/>|业务线:
		<select name="bussiness">
						<option value="">请选择</option>
						<option value="SMS">SMS</option>
						<option value="MMS">MMS</option>
						<option value="IVR">IVR</option>
						<option value="视频基地">视频基地</option>
						<option value="百宝箱游戏">百宝箱游戏</option>
						<option value="G+游戏">G+游戏</option>
						<option value="动漫基地">动漫基地</option>
						<option value="阅读基地">阅读基地</option>
						<option value="MM基地">MM基地</option>
						<option value="MDO业务">MDO业务</option>
					</select>
		<input type="submit" value="查询">
		</form>
	</div>
	<table align="center" width="100%">
		<tr class="list" align="center">
		<td width="80">SP名称</td>
		<td width="100">业务线</td>
		<td width="100">分成比率</td>
		<td width="100">结算周期</td>
		<td width="100">指令简述</td>
		<td width="100">状态</td>
		<td width="100">公司简介</td>
		<td width="100">操作</td>
		</tr>
	
	
		<c:forEach items="${pageBean.result}" var="company" varStatus="status">
		
			<tr class="${status.index%2==0?'noselect':'select' }" align="center">
				<td><a href="<%=request.getContextPath() %>/admin/sp/list?companyId=${company.companyId}">${company.companyName }</a></td>
				<td>${company.bussiness }</td>
				<td>${company.sppercent }</td>
				<td>${company.spcheck }</td>
				<td>${company.commandMemo }</td>
				<td>${company.spstatus==1?'有效':'无效' }</td>
				<td>${company.companyMemo }</td>
				<td><a href="#" onclick="show('${company.companyId }');">查看</a></td>
			</tr>
		
		</c:forEach>
	</table>
	
	<!-- 
	<div class="listTitle">
		<ul>
			<li style="width:80px;">SP名称</li>
			<li style="width:60px;">业务线</li>
			<li style="width:150px;">分成比率</li>
			<li style="width:100px;">结算周期</li>
			<li style="width:150px;">指令简述</li>
			<li style="width:100px;">状态</li>
			<li style="width:200px;">公司简介</li>
			<li style="width:150px;">操作</li>
			
		</ul>
		<div class="clear"></div>
	</div>
	<div class="list">
		<c:forEach items="${pageBean.result}" var="company">
			<div class="${status.index%2==0?'noselect':'select' }">
				<ul>
					<li style="width:80px;"></li>
					
					<li style="width:60px;"></li>
					<li style="width:150px;"></li>
					<li style="width:100px;"></li>
					<li style="width:150px;"></li>
					<li style="width:100px;"></li>
					<li style="width:200px;"></li>
					<li style="width:150px;">
						<a href="#" onclick="show('${company.companyId }');">查看</a>
					</li>
				</ul>
				<div class="clear"></div>
			</div>
		</c:forEach>
	</div>
	 -->
	<jsp:include page="../page.jsp" flush="true"></jsp:include>
	<div class="search">
		<input type="button" name="addCompany" id="addCompany" value="添加SP合作商==>>" />
	</div>
</div>
</body>
</html>